<template>
	<view class="about">
		<image class="logo" src="/static/img/head.png" ></image>
		<!-- <text class="sign">{{version}}</text>
		<view class="mode flex-box">
			<text class="box-1">版本更新</text>
			<text class="mode-text" @tap="versionUp">{{version}}</text>
			<text class="res-cli" v-if="version_new"></text>
		</view> -->
		<view class="mode flex-box" @tap="jumpUrl(base+'/index/user_service_agreement')">
			<text class="box-1">用户协议</text>
			<uni-icons type="arrowright" color="#bbb"></uni-icons>
		</view>
		<view class="mode flex-box" @tap="jumpUrl(base+'/index/privacy_policy')">
			<text class="box-1">隐私政策</text>
			<uni-icons type="arrowright" color="#bbb"></uni-icons>
		</view>
	</view>
</template>

<script>
	// import APPUpdate from "@/common/APPUpdate.js";
	// import app from "@/common/js/comm_url.js";
	export default {
		data() {
			return {
				version:'',
				comm_img_url:null,
				version_new:false,
        base:''
			};
		},
		created:function(){
			// this.checkUpdate();
		},
		onLoad() {
			this.comm_img_url = this.$c.appImg;
			this.base = this.$c.domain;

		},
		methods:{
			versionUp:function(){
				if(this.version_new){
					APPUpdate(true);
				}
			},
			checkUpdate:function(){
				var self = this;
				plus.runtime.getProperty(plus.runtime.appid,res=>{
					this.version = res.version;
					let httpData = {
						version:res.version
					};
					let platform = uni.getSystemInfoSync().platform.toLowerCase()
					if (platform == "android") {
						httpData.type = 1101;
					} else {
						httpData.type = 1102;
					}
					this.$u.api.app_version(httpData).then(ret=>{
						// console.log(ret);
						if(ret.status){
							this.version_new = true
						}
					}).catch(err=>{console.log(err);});
				})	
			},
			jumpUrl(url){
				console.log(url,'url')
				// plus.runtime.openWeb(url)

				uni.navigateTo({
					url: "/pages/web-view/web-view?url=" + JSON.stringify(url)
				})
			}
		}
	}
</script>

<style lang="scss">
	@import 'AboutUs.scss';
	
</style>
